<template>
    <div>
        <div class="itemBox" @click="jump()">
            <div class="item-thumbnail">
                <div style="width:376px;height:212px;"><img :src="pic" :data-src="pic" alt="expanding-cards"
                        class="item-img"></div>
            </div>
            <h2 class="itemFont">{{ title }}</h2>
            <div class="item-tags">
                <div class="tag">
                    <i class="iconfont icon-lunzi"></i>
                    {{ tag }}
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'card',
    component: {},
    props: {
        pic: {
            type: String,
            default: "https://pic.imgdb.cn/item/651fc749c458853aefab920e.png"
        },
        title: {
            type: String,
            default: "标题"
        },
        tag: {
            type: String,
            default: "轮子"
        },
        router: {
            type: String,
            default: "codeGarden"
        }
    },
    data() {
        return {}
    },
    computed: {},
    watch: {
    },
    methods: {
        jump() {
            this.$router.push({
                path: this.router,
                query: {
                    src: this.pic,
                }
            })
        }
    },
    created() { },
    mounted() { },
    destroyed() { }
}
</script>

<style scoped lang="less">
.itemBox {
    width: 400px;
    height: 300px;
    border-radius: 10px;
    border: 2px solid gray;
    margin: 20px;
    box-shadow: 0 0 13px #808080a3;

    .item-thumbnail {
        box-shadow: 0 0 10px #aed0ee;
        margin: 10px;
        border-radius: 15px;

        .item-img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 15px;
        }
    }

    .itemFont {
        font-size: 15px;
        margin-left: 15px;
    }

    .item-tags {
        display: flex;
        flex-direction: row-reverse;

        .tag {
            font-size: 11px;
            padding: 3px 5px;
            margin-right: 5px;
            margin-right: 10px;
            border-radius: 5px;
            color: #ff7917;
            background-color: rgba(255, 111, 6, 0.1);
        }
    }
}
</style>
